<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<link rel="stylesheet" type="text/css" href="estilos.css" />

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Banca Alecrim</title>
</head>

<f:view>
	<h:form>
		<body>
			<jsp:include page="topoPagina.jsp" />
			
			<br/><br/>
			<h:messages layout="table" styleClass="mensagemErro" errorClass="mensagemError" />
			<br/>
						
			<h:dataTable value="#{fornecedorMBean.listFornecedor}" var="fornecedor"
				headerClass="headerClass" rowClasses="linhaPar,linhaImpar" styleClass="dataTableClass"
				columnClasses="colunaCNPJ,colunaNome">
				<h:column>
					<f:facet name="header">
						<h:outputText value="CNPJ"></h:outputText>
					</f:facet>
					<h:outputText value="#{fornecedor.CNPJ}"></h:outputText>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Nome do Fornecedor"></h:outputText>
					</f:facet>
					<h:outputText value="#{fornecedor.nome}"></h:outputText>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value=""></h:outputText>
					</f:facet>
					<h:commandLink action="#{fornecedorMBean.visualizarFornecedor}">
						<h:graphicImage value="icones/view.gif" title="Visualizar Fornecedor" styleClass="img"/>
					</h:commandLink>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value=""></h:outputText>
					</f:facet>
					<h:commandLink action="#{fornecedorMBean.RemoverFornecedor}" 
						onclick='return confirm("Deseja realmente remover o fornecedor?")'>
						<h:graphicImage value="icones/remove.gif" title="Remover Fornecedor" styleClass="img"/>
					</h:commandLink>
				</h:column>
			</h:dataTable>			
		</body>
	</h:form>
</f:view>

</html>	